package com.csu.cphone.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.csu.cphone.service.OrderService;
import com.wordnik.swagger.annotations.Api;
import com.wordnik.swagger.annotations.ApiOperation;
import com.wordnik.swagger.annotations.ApiParam;

/**
 * @项目名称：cphone
 * @类名称：OrderController
 * @类描述：
 * @创建人：Tangc
 * @创建时间：2017年9月14日 下午7:10:12
 * @company:
 */
@Controller
@RequestMapping("/order")
@Api(value = "order", description = "订单信息")
public class OrderController
{

    @Autowired
    private OrderService orderService;

    // 创建订单
    @ResponseBody
    @ApiOperation(value = "创建正式订单", notes = "用户创建正式订单")
    @RequestMapping(value = "/createOrder", method = RequestMethod.POST, produces = { "application/json; charset=utf-8" })
    public String createOrder(HttpServletRequest request, HttpServletResponse response,
            @ApiParam(value = "订单类型") @RequestParam(value = "type", required = true) int type,
            @ApiParam(value = "服务类型") @RequestParam(value = "seviceType", required = false) int serviceType,
            @ApiParam(value = "订单状态") @RequestParam(value = "status", required = false) int status,
            @ApiParam(value = "用户id") @RequestParam(value = "customerId", required = true) int customerId,
            @ApiParam(value = "服务商id") @RequestParam(value = "producerId", required = true) int producerId,
            @ApiParam(value = "订单申请时间") @RequestParam(value = "applyTime", required = false) String applyTime,
            @ApiParam(value = "服务方接受时间") @RequestParam(value = "acceptTime", required = false) String acceptTime,
            @ApiParam(value = "服务方完成时间") @RequestParam(value = "finishTime", required = false) String finishTime,
            @ApiParam(value = "用户确认时间") @RequestParam(value = "confirmTime", required = false) String confirmTime,
            @ApiParam(value = "预约上门服务时间") @RequestParam(value = "serviceTime", required = false) String serviceTime,
            @ApiParam(value = "门店id") @RequestParam(value = "storeId", required = false) int storeId,
            @ApiParam(value = "快递单号") @RequestParam(value = "emailId", required = false) String emailId,
            @ApiParam(value = "iphone密码信息") @RequestParam(value = "iPhonePasswd", required = false) String iPhonePasswd,
            @ApiParam(value = "订单报价") @RequestParam(value = "offerPrice", required = true) double offerPrice)
    {
        // 第一步，订单处理

        // 第二步，返回处理结果

        return null;
    }

    // 更新订单

    // 查询订单

    // 删除订单

}
